/**
 * 
 */
package edu.sjtu.se.prophet.driver;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.Properties;

import org.apache.log4j.Logger;

/**
 * @author willard
 * 
 */
public abstract class DefaultPropertiesLoader {
    private static Logger logger = Logger
            .getLogger(DefaultPropertiesLoader.class);

    public static String SPLITER = "[,;:]";

    protected Properties properties = new Properties();

    public void load(String[] args) throws FileNotFoundException, IOException {
        String propFile = "default.properties";
        if (args.length > 0) {
            propFile = args[0];
        } else {
            logger.info("Using default properties file.");
        }

        properties = new Properties();
        properties.load(new FileInputStream(propFile));
    }
}
